﻿using LuShanTea.Service.Entities;
using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LuShanTea.Service.ModelConfig
{
    public class GoodImgConfig:EntityTypeConfiguration<GoodImgSrc>
    {
        public GoodImgConfig()
        {
            this.ToTable("T_GoodImgSrcs");
            this.Property(e => e.ThumImgSrc).IsRequired().HasMaxLength(248);

            this.Property(e => e.ImgSrc).IsRequired().HasMaxLength(128);

            this.Property(e => e.DescImgSrc).HasMaxLength(128);

            this.HasRequired(e => e.Good).WithMany().HasForeignKey(e => e.GoodId).WillCascadeOnDelete(false);
        }
    }
}
